package com.sqtracker.recommender.repository;

import com.sqtracker.recommender.model.Rating;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface RatingRepository extends MongoRepository<Rating, String> {
    List<Rating> findByTorrentId(String torrentId);
    List<Rating> findByUserId(String userId);
    Optional<Rating> findByUserIdAndTorrentId(String userId, String torrentId);
    double getAverageScoreByTorrentId(String torrentId);
    long countByTorrentId(String torrentId);
} 